The previous article mentioned how to use Dom to parse and operate XML in Java. This article explains how to use SAX to parse and operate XML in Java, which is a little clear on the mobile platform, the XML-based event mechanism can save a lot of
First, we will introduce the basic knowledge of sax, Dom, JAXP, JDOM, and dom4j:(Note: For JAXP | jaxb | jaxm | jaxr | what the JAX-RPC is, view the http://gceclub.sun.com.cn/staticcontent/html/xml/faq/#jaxr)
1. Sax and Dom are two methods for
Dom Parsing
In the DOM interface specification, there are four basic interfaces: Document, node, nodelist, and namednodemap. Among the four basic interfaces, the document interface is the entry for document operations, which is inherited from the
Sax features (SAX is short for SimpleAPIforXML) 1. high resolution efficiency, less memory occupied 2. resolution can be stopped at any time. 3. the entire document cannot be loaded into memory. 4. the xml file cannot be written to xml5.SAX for
1. XML Programming (CRUD), crud refers to: C is Create;r is the read;u is the update;d is delete, that is, the database of additions and deletions to check, XML technology is actually equivalent to the database.
2.XML Analysis Technology Overview
L
1. Write an xml file in the assets File[Html] v Li Ming 30 Li xiangmei 25
Li Ming 30 Li xiangmei 25 2. Write a SAX-parsed class in the service
[Java]Package com. example. service;
Import java. util. ArrayList;Import java. util. List;
Import
Android parsing XML Summary-three methods: SAX, Pull, and DomXml File Parsing is often used in android development. common xml parsing methods include SAX, Pull, and Dom. Recently I made a CSDN reader for android, using two of them (sax and pull).
with the learning of Android parsing XML became a question many friends faced. To learn how to parse XML, you should first understand what XML is.XML, known as Extensible Markup Language (extensible Markup Language), is developed by the standard
Android-based SAX parsing XML file, androidsaxxml1. Introduction to the SAX Parsing Method
SAX (Simple API for XML) is an XML parser with fast resolution speed and low memory usage. It is very suitable for Android and other mobile devices.
The SAX
Currently, two methods are used for XML parsing:
1. Dom parsing: (Document Object Model, that is, Document Object Model) is a method recommended by W3C for parsing XML.
Use Dom to parse an XML document. The parser first loads the XML document into
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.